package gstyle;

import com.google.gwt.user.client.ui.Widget;

public class CssClass extends Style<CssClass> implements CanSetOnWidget, CssSelector, XPathSelector {
    public CssClass(String name) {
        super(name);
    }

    String getName() {
        return "." + name;
    }

    public <T extends Widget> T setOn(T widget) {
        widget.setStyleName(name);
        return widget;
    }

    public String toSelector() {
        return getName();
    }

    public String toXPath() {
        return "[@class='" + name + "']";
    }
}


